package com.jia.interviewPro;

/**
 * 面试题 16.11. 跳水板
 */
public class Pro1611 {
    public int[] divingBoard(int shorter, int longer, int k) {
        if(k <= 0) return new int[]{};
        if(shorter == longer) return new int[]{shorter * k};
        int[] ans = new int[k+1];
        //shorter * k; shorter * k + (longer - shorter) * 1; shorter * k + (longer - shorter) * 2; ...; shorter * k + (longer - shorter) * k
        for(int i = 0; i <= k; i++) {
            ans[i] = shorter * k + (longer - shorter) * i;
        }
        return ans;
    }
}
